RasPrj Attributes

These should be simple tool calls that provide HEC-RAS project information

plan_df (pd.DataFrame): DataFrame containing plan file information.
flow_df (pd.DataFrame): DataFrame containing flow file information.
unsteady_df (pd.DataFrame): DataFrame containing unsteady flow file information.
geom_df (pd.DataFrame): DataFrame containing geometry file information.
boundaries_df (pd.DataFrame): DataFrame containing boundary condition information.
rasmap_df (pd.DataFrame): DataFrame containing RASMapper configuration data including paths to terrain, soil layer, infiltration, and land cover data.


Generic HDF Utilities:

Class: HdfBase
Contains fundamental static methods for interacting with HEC-RAS HDF files. Used by other Hdf* classes. Requires an open h5py.File object or uses @standardize_input.

HdfBase.get_projection(hdf_path)
Purpose: Retrieves the spatial projection information (WKT string) from the HDF file attributes or associated .rasmap file.
Parameters:
hdf_path (Input handled by @standardize_input): Path identifier for the HDF file.
Returns: (str or None): Well-Known Text (WKT) string of the projection, or None if not found.


HdfBase.get_dataset_info(file_path, group_path='/')
Purpose: Prints a recursive listing of the structure (groups, datasets, attributes, shapes, dtypes) within an HDF5 file, starting from group_path.
Parameters:
file_path (Input handled by @standardize_input): Path identifier for the HDF file.
group_path (str, optional): Internal HDF path to start exploration from. Default is root ('/').
Returns: None. Prints to console.





HEC-RAS Project Infiltration Data

The infiltration and soil HDF paths can be found in the rasmap_df


HdfInfiltration.get_infiltration_layer_data(hdf_path: Path) -> Optional[pd.DataFrame]
Purpose: Retrieves current infiltration parameters from a HEC-RAS infiltration layer HDF file.
Parameters:
hdf_path (Input handled by @standardize_input): Path identifier for the infiltration layer HDF.
Returns: Optional[pd.DataFrame]: DataFrame containing infiltration parameters if successful, None if operation fails.


HdfInfiltration.get_significant_mukeys(soil_stats: pd.DataFrame, threshold: float = 1.0) -> pd.DataFrame
Purpose: Gets mukeys with percentage greater than threshold.
Parameters:
soil_stats (pd.DataFrame): DataFrame with soil statistics.
threshold (float, optional): Minimum percentage threshold. Default 1.0.
Returns: pd.DataFrame: DataFrame with significant mukeys and their statistics.


HdfInfiltration.calculate_total_significant_percentage(significant_mukeys: pd.DataFrame) -> float
Purpose: Calculates total percentage covered by significant mukeys.
Parameters:
significant_mukeys (pd.DataFrame): DataFrame of significant mukeys.
Returns: float: Total percentage covered by significant mukeys.


HdfInfiltration.calculate_weighted_parameters(soil_stats: pd.DataFrame, infiltration_params: dict) -> dict
Purpose: Calculates weighted infiltration parameters based on soil statistics.
Parameters:
soil_stats (pd.DataFrame): DataFrame with soil statistics.
infiltration_params (dict): Dictionary of infiltration parameters by mukey.
Returns: dict: Dictionary of weighted average infiltration parameters.


HdfInfiltration.get_infiltration_baseoverrides(hdf_path: Path) -> Optional[pd.DataFrame]
Purpose: Retrieves current infiltration parameters from a HEC-RAS geometry HDF file.
Parameters:
hdf_path (Input handled by @standardize_input, file_type='geom_hdf'): Path identifier for the geometry HDF.
Returns: Optional[pd.DataFrame]: DataFrame containing infiltration parameters if successful, None if operation fails.



Functions to get Results information from a Plan HDF:

Lump these into a single tool call - get_plan_results_summary



Class: HdfResultsPlan
Contains static methods for extracting general plan-level results and summary information from HEC-RAS plan HDF files.

HdfResultsPlan.get_unsteady_info(hdf_path)
Purpose: Extracts attributes from the 'Results/Unsteady' group in the plan HDF file.
Parameters:
hdf_path (Input handled by @standardize_input, file_type='plan_hdf'): Path identifier for the plan results HDF.
Returns: pd.DataFrame: Single-row DataFrame containing the unsteady results attributes.
Raises: FileNotFoundError, KeyError, RuntimeError.

HdfResultsPlan.get_unsteady_summary(hdf_path)
Purpose: Extracts attributes from the 'Results/Unsteady/Summary' group in the plan HDF file.
Parameters:
hdf_path (Input handled by @standardize_input, file_type='plan_hdf'): Path identifier for the plan results HDF.
Returns: pd.DataFrame: Single-row DataFrame containing the unsteady summary attributes.
Raises: FileNotFoundError, KeyError, RuntimeError.

HdfResultsPlan.get_volume_accounting(hdf_path)
Purpose: Extracts attributes from the 'Results/Unsteady/Summary/Volume Accounting' group in the plan HDF file.
Parameters:
hdf_path (Input handled by @standardize_input, file_type='plan_hdf'): Path identifier for the plan results HDF.
Returns: (pd.DataFrame or None): Single-row DataFrame containing volume accounting attributes, or None if the group doesn't exist.
Raises: FileNotFoundError, RuntimeError.

HdfResultsPlan.get_runtime_data(hdf_path)
Purpose: Extracts detailed computational performance metrics (durations, speeds) for different simulation processes (Geometry, Preprocessing, Unsteady Flow) from the plan HDF file.
Parameters:
hdf_path (Input handled by @standardize_input, file_type='plan_hdf'): Path identifier for the plan results HDF.
Returns: (pd.DataFrame or None): Single-row DataFrame containing runtime statistics, or None if data is missing or parsing fails.













